import React, {PureComponent} from 'react';
import {StyleSheet, View, Text, TouchableOpacity, Image} from 'react-native';

export default class extends PureComponent {
    render() {
        const {goBack, itemInfo} = this.props;
        return (
            <View style={styles.container}>
                <View style={styles.bar}/>
                <View style={styles.content}>
                    <View style={styles.leftContent}>
                        <TouchableOpacity onPress={goBack}>
                            <Image source={require('../../../images/icon_arrow_left.png')} style={styles.backImg}/>
                        </TouchableOpacity>
                        <Image source={require('./img/avatar.png')} style={styles.avatar}/>
                        <View style={styles.textWrap}>
                            <Text style={styles.textH2}>{itemInfo.author}</Text>
                            <Text style={styles.textH3}>1000粉丝</Text>
                        </View>
                    </View>
                </View>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        paddingBottom: 10
    },
    bar: {
        height: 20,
        backgroundColor: '#f0f0f0',
        marginBottom: 10
    },
    content: {
        flexDirection: 'row',
        justifyContent: 'space-between',
        alignItems: 'center',
        paddingLeft: 16,
        paddingRight: 20
    },
    leftContent: {
        flexDirection: 'row',
        justifyContent: 'flex-start',
        alignItems: 'center'
    },
    backImg: {
        width: 30,
        height: 30,
        marginRight: 20
    },
    avatarImg: {
        width: 30,
        height: 30
    },
    textWrap: {
        marginLeft: 12,
        height: 24,
        justifyContent: 'space-between'
    },
    textH2: {
        fontSize: 13,
        color: '#272727',
        lineHeight: 18
    },
    textH3: {
        fontSize: 10,
        color: '#272727',
        lineHeight: 16
    },
    btnWrap: {
        paddingLeft: 12,
        paddingRight: 12,
        backgroundColor: '#f85959',
        borderRadius: 4
    },
    btnText: {
        fontSize: 13,
        color: '#fefefe',
        height: 24,
        lineHeight: 24
    }
});
